package com.cn.wanxi.thread.join;

public class ThreadThree extends Thread {
    private ThreadTwo threadTwo;

    public ThreadThree(ThreadTwo threadTwo) {
        this.threadTwo = threadTwo;
    }

    public void run() {
        System.out.println("线程3开始跑");
        synchronized (threadTwo) {
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

        System.out.println("线程3结束跑");
    }
}